home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / editor / fwpspchs.lha / FWEPSPatches / Install FW EPS patch < prev    next >
Text File  |  1995-08-19  |  4KB  |  189 lines

  1. ; $VER: Install FW EPS patch 1.01 (19.8.1995) © Manuel Lemos 1995
  2. ; Script to install a patch to FinalWriter Releases 1, 2, 3 and 4 to let it render EPS files that use PostScript fonts.
  3.  
  4. (
  5.     procedure PatchInitPSFile
  6.     (
  7.         (
  8.             if (= renamed-old-init 0)
  9.             (
  10.                 (
  11.                     copyfiles
  12.                     (source destination$)
  13.                     (dest @default-dest)
  14.                     (newname "init.ps.old")
  15.                 )
  16.                 (set renamed-old-init 1)
  17.             )
  18.         )
  19.         (set patch$ (tackon source$ patch$))
  20.         (set spatch$ (tackon source$ "spatch"))
  21.         (set result (run ("\"%s\" \"-p%s\" \"-o%s\" \"%s\"" spatch$ patch$ destination$ (tackon @default-dest "init.ps.old"))))
  22.     )
  23. )
  24.  
  25. (
  26.     set prompt-where$
  27.     "Please indicate where in disk was installed FinalWriter."
  28. )
  29. (
  30.     set help-where$
  31.     (
  32.         cat
  33.         "Please indicate where in disk was installed FinalWriter.\n\nThe "
  34.         "directory where FinalWriter was installed must contain sub-directory "
  35.         "named \"FWFiles\" with a file named \"init.ps\" in it.\n\n"
  36.     )
  37. )
  38. (
  39.     set init.ps-doesnt-exist$
  40.     (
  41.         cat
  42.         "Apparently the \"init.ps\" does not exist or is unreadable.\n\n"
  43.         "Being so, it is not possible to install this patch!\n\n"
  44.         "Sorry, please contact Softwood."
  45.     )
  46. )
  47. (
  48.     set FWFiles-not-here$
  49.     (
  50.         cat
  51.         "Apparently FinalWriter was not installed in this directory.\n\n"
  52.         "The directory where FinalWriter was installed has a sub-directory "
  53.         "named \"FWFiles\" in it."
  54.     )
  55. )
  56. (
  57.     set patch-is-already-installed$ "Apparently the patch was already installed."
  58. )
  59. (
  60.     set unknown-version$ "An unknown version of the \"init.ps\" is installed!\n\n"
  61. )
  62. (
  63.     set changed-version$
  64.     (
  65.         cat
  66.         "If you have edited the file or somehow it was changed, please restore "
  67.         "the original file from the original installation disks.\n\n"
  68.         "NOTE:  Keep in mind that this patch only applies to FinalWriter "
  69.         "Release 1, 2, 3 or 4."
  70.     )
  71. )
  72. (
  73.     set prompt-release$ "Which Release of FinalWriter do you have installed?"
  74. )
  75. (
  76.     set help-release$
  77.     (
  78.         cat 
  79.         "This patch only applies to FinalWriter Release 1, 2, 3 or 4.  Please "
  80.         "specify the Release you have installed.\n\n"
  81.         "If you don't have any of these versions properly installed, this patch "
  82.         "is useless for you.\n\n"
  83.     )
  84. )
  85. (
  86.     set wrong-version$
  87.     (
  88.         cat
  89.         "Apparently you don't have installed the Release of FinalWriter that "
  90.         "you have specified!\n\n"
  91.         "Please specify again which Release you have installed.\n\n"
  92.     )
  93. )
  94. (set source$ (expandpath ""))
  95. (set FinalWriter$ (tackon @default-dest "FinalWriter"))
  96. (set destination$ "")
  97. (
  98.     until (AND (<> "" destination$) (exists destination$))
  99.     (
  100.         (
  101.             set FinalWriter$
  102.             (
  103.                 askdir
  104.                     (prompt prompt-where$)
  105.                     (help (cat help-where$ @askoptions-help))
  106.                     (default FinalWriter$)
  107.                     (disk)
  108.             )
  109.         )
  110.         (set destination$ (tackon FinalWriter$ "FWFiles"))
  111.         (
  112.             if (exists destination$)
  113.             (
  114.                 (
  115.                     if (= 0 (exists (tackon destination$ "init.ps")))
  116.                     (
  117.                         abort init.ps-doesnt-exist$
  118.                     )
  119.                 )
  120.             )
  121.             (
  122.                 message FWFiles-not-here$
  123.             )
  124.         )
  125.     )
  126. )
  127. (set @default-dest destination$)
  128. (set destination$ (tackon destination$ "init.ps"))
  129. (set filesize (getsize destination$))
  130. (set renamed-old-init 0)
  131. (
  132.     if (= filesize 5993)
  133.     (
  134.         (set result 1)
  135.         (set release 0)
  136.         (
  137.             until (= 0 result)
  138.             (
  139.                 (
  140.                     if
  141.                     (= 0
  142.                         (
  143.                             set release
  144.                             (
  145.                                 askchoice
  146.                                 (prompt prompt-release$)
  147.                                 (help (cat help-release$ @askchoice-help))
  148.                                 (choices "Release 1 or 2" "Release 3")
  149.                                 (default release)
  150.                             )
  151.                         )
  152.                     )
  153.                     (set patch$ "FinalWriter1_2-init.ps.pch")
  154.                     (set patch$ "FinalWriter3-init.ps.pch")
  155.                 )
  156.                 (PatchInitPSFile)
  157.                 (
  158.                     if (<> 0 result)
  159.                     (
  160.                         message wrong-version$ changed-version$
  161.                     )
  162.                 )
  163.             )
  164.         )
  165.     )
  166.     (
  167.         if (= filesize 5991)
  168.         (
  169.             (set patch$ "FinalWriter4-init.ps.pch")
  170.             (PatchInitPSFile)
  171.             (
  172.                 if (<> 0 result)
  173.                 (
  174.                     abort unknown-version$ changed-version$
  175.                 )
  176.             )
  177.         )
  178.         (
  179.             if (= filesize 6215)
  180.             (
  181.                 abort patch-is-already-installed$
  182.             )
  183.             (
  184.                 abort unknown-version$ changed-version$
  185.             )
  186.         )
  187.     )
  188. )
  189.